package ;
import neko.FileSystem;
import neko.io.File;
import neko.Lib;
using StringTools;

/**
 * ...
 * @author Metal Slime
 */

class GernerateBat 
{
	static function main():Void {
		new GernerateBat();
	}
	
	public function new() 
	{
		var fnames = FileSystem.readDirectory("../src/jsfl");
		var content:Array<String> = [];
		
		for (name in fnames) {
			//Lib.println(~/^Op_/.match(name));
			if (~/\.hx$/.match(name) && ~/^Op_/.match(name) && name != "GernerateBat.hx") {
				name = name.replace(".hx", "");
				content.push(Std.format("haxe -cp src -js E:/ZhangDongCai/svns/daily/HaxeJsfl/bin/${name}.jsfl -main jsfl.${name}"));
			}
		}
		File.saveContent("../src/generateJs.bat", content.join("\n"));
	}
	
}